package com.zz.mapper;

import com.zz.model.Book;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.StatementType;

import java.rmi.MarshalledObject;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/1/11.
 */
public interface BookMapper {
    public void insert(Book book);

    public List<Book> query();

    public List<Book> show();

    @Select("call myshow")
    @Options(statementType = StatementType.CALLABLE)
    @ResultMap("mybook")
    public List<Book> sshh();

    @Insert("call mysave(#{0},#{1})")
    @Options(statementType = StatementType.CALLABLE)
    @ResultMap("mybook")
    public int save(String na, double pr);

    public int deletee(int id);

    public int update(int id, String name, double price);

    @Update("call myupd(#{name},#{price},#{id})")
    @Options(statementType = StatementType.CALLABLE)
    public int myupdate(Book book);

    public Map<String, Integer> selCount(Map<String, Integer> m);

    public List<Book> page(int start,int pagesize);

}
